/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
const path = require('path')
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1650164392984_4640';

  // add your middleware config here
  config.middleware = [];

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',

  };
  config.sequelize = {
    dialect: 'mysql',
    database: 'blog',
    host: 'localhost',
    port: 3306,
    username: 'root',
    password: 'root'
  }

  config.cors = {
    origin: '*',
    credentials: true,
    allowMethods: 'GET,HEAD,PUT,POST,PATCH,DELETE'
};

config.JWT = {
  secret: "123456"
}

config.security = {
  csrf: {
    enable: false
  }
},

config.static = {
  prefix: '/',
  dir:path.join(appInfo.baseDir,'app/public')
}


  return {
    ...config,
    ...userConfig,
  };
};
